/*
 * tree.c
 *
 *  Created on: Jan 30, 2012
 *      Author: nuno
 */

#include <stdio.h>
#include <stdlib.h>



typedef struct str_tree TreeNode;

struct str_tree {
    int id;
    TreeNode * left;
    TreeNode * right;
} Tree;

TreeNode * root;

void inserir_node(int num) {
    TreeNode * left = (TreeNode*) malloc(sizeof (TreeNode));
    left->id = num;
    left->left = root;
    left->right = NULL;
    root = left;
}

/*
 * argumentos por referencia
 */
void func(int * x) {
    (*x) = 10;
}

int main_tree() {

    int var = 5;
    printf("var=%d\n", var);
    func(&var);
    printf("var=%d\n", var);
    return 0;
}
